package com.changgou.page.listener;


import com.changgou.page.config.RabbitMQConfig;
import com.changgou.page.service.PageService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class PageListener {
    @Autowired
    private PageService pageService;

    @RabbitListener(queues = RabbitMQConfig.PAGE_CREATE_QUEUE)
    public void createMessage(String supId){
        System.out.println("获取商品静态化的id，id的值为："+supId);

        //调用业务层，完成静态页面的生成
        pageService.createHtml(supId);
    }
}
